package com.hy.erp.inventory.pojo;

import java.util.Date ;
import java.util.List ;

import javax.persistence.CascadeType ;
import javax.persistence.Column ;
import javax.persistence.Entity ;
import javax.persistence.FetchType ;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany ;
import javax.persistence.OneToOne ;
import javax.persistence.Table ;
import javax.persistence.Temporal ;
import javax.persistence.TemporalType ;

import org.hibernate.annotations.Index ;
import org.hibernate.annotations.IndexColumn;
//import org.jboss.seam.annotations.Name ;

import com.hy.erp.inventory.dao.interfaces.IPersonDao;
import com.hy.erp.inventory.pojo.interfaces.IAddress;
import com.hy.erp.inventory.pojo.interfaces.IContact;
import com.hy.erp.inventory.pojo.interfaces.IEducation;
import com.hy.erp.inventory.pojo.interfaces.IFamily;
import com.hy.erp.inventory.pojo.interfaces.IHealth;
import com.hy.erp.inventory.pojo.interfaces.INation;
import com.hy.erp.inventory.pojo.interfaces.IOrganisation;
import com.hy.erp.inventory.pojo.interfaces.IPerson;
import com.hy.erp.inventory.pojo.interfaces.IPhysiqueCharacter;
import com.hy.erp.inventory.pojo.interfaces.IRewardsPunishment;
import com.hy.erp.inventory.pojo.interfaces.ISkillLevel;
import com.hy.erp.inventory.pojo.interfaces.ITraining;
import com.hy.erp.inventory.pojo.interfaces.IWorking;
import com.hy.erp.inventory.pojo.interfaces.IDepot;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;
/*import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.api.annotation.DaoA;
import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.entity.AbstractPersistentEntity;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;
/**
 * 
 * <ul>
 * <li>开发作者：李冰</li>
 * <li>设计日期：2010-10-5；时间：上午09:29:28</li>
 * <li>类型名称：Person</li>
 * <li>设计目的：人员</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
/**
 * <ul>
 * <li>开发作者：汤莉</li>
 * <li>设计日期：2010-12-8；时间：下午04:16:43</li>
 * <li>类型名称：Person</li>
 * <li>设计目的：</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
//@ Entity 
/*@Table(name="person") 
@Name("person")
@DaoA(IPersonDao.class)*/
//public class Person extends AbstractPersistentEntity implements  IPerson
public class Person extends MyBaseModel //implements IPositonType

{

	/**
	 * <ul>
	 * <li>开发作者：李冰</li>
	 * <li>设计日期：2010-9-24；时间：下午05:46:30</li>
	 * <li>字段类型：long；字段名称：serialVersionUID</li>
	 * <li>设计目的：</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 */
	private static final long	serialVersionUID	=
														- 7450574008051932454L ;
	
	

	public Person ( )
	{
		
	}
	
	@ Column ( name = "name" , length = 50 )
	public String getName ( )
	{
		return this.get(IPerson.NAME) ;
	}

	public void setName (
							String name )
	{
		super.set(IPerson.NAME,name) ;
	}

	@ Column ( name = "workerNumber" , length = 50 )
	public String getWorkerNumber ( )
	{
		return this.get(IPerson.WORKERNUMBER) ;
	}

	public void setWorkerNumber (
							String workerNumber )
	{
		super.set(IPerson.WORKERNUMBER,workerNumber) ;
	}
	
	

	@ Column ( name = "birth" , length = 50)
	@ Index ( name = "birthIdIndex" )
	public Date getBirth ( )
	{
		return this.get(IPerson.BIRTH) ;
	}
	public void setBirth (
							Date birth )
	{
		super.set(IPerson.BIRTH,birth) ;
	}
	@ Column ( name = "picture" , length = 50)
	@ Index ( name = "pictureIndex" )
	public String getPicture ( )
	{
		return this.get(IPerson.PICTURE) ;
	}
	
	public void setPicture (
								String picture )
	{
		super.set(IPerson.PICTURE,picture) ;
	}
	@ Column ( name = "sex" , length = 50)
	@ Index ( name = "sexIndex" )
	public String getSex ( )
	{
		return this.get(IPerson.SEX) ;
	}
	public void setSex (
							String sex )
	{
		super.set(IPerson.SEX,sex) ;
	}
	@ Column ( name = "bloodtype" , length = 50)
	@ Index ( name = "bloodtypeIndex" )
	public String getBloodtype ( )
	{
		return this.get(IPerson.BLOODTYPE) ;
	}
	public void setBloodtype (
								String bloodtype )
	{
		super.set(IPerson.BLOODTYPE,bloodtype) ;
	}
	@ Column ( name = "origin" , length = 50)
	@ Index ( name = "originIndex" )
	public String getOrigin ( )
	{
		return this.get(IPerson.ORIGIN) ;
	}
	public void setOrigin (
							String origin )
	{
		super.set(IPerson.ORIGIN,origin) ;
	}
//	@OneToOne(targetEntity=Address.class,fetch=FetchType.LAZY)
	@ Column ( name = "homeplace" , length = 50)
	public String getHomeplace ( )
	{
		return this.get(IPerson.HOMEPLACE) ;
	}
	public void setHomeplace (
								String homeplace )
	{
		super.set(IPerson.HOMEPLACE,homeplace) ;
	}
//	@OneToOne(targetEntity=Nationalities.class,fetch=FetchType.LAZY)
	@OneToOne(targetEntity=Nation.class,fetch=FetchType.EAGER,cascade=CascadeType.ALL)
	public Nation getNation ( )
	{
		return this.get(IPerson.NATIONALITIES) ;
	}
	public void setNation (
									Nation nation )
	{
		super.set(IPerson.NATIONALITIES,nation) ;
	}
	
//	@OneToMany(targetEntity=Education.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@OneToMany(targetEntity=Education.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@IndexColumn(name="list_index")
	@JoinColumn(name="Person_identifier")
	public List < IEducation > getEducation ( )
	{
		return this.get(IPerson.EDUCATION) ;
	}
	public void setEducation (
								List < IEducation > education )
	{
		super.set(IPerson.EDUCATION,education) ;
	}
	
	
//	@OneToMany(targetEntity=Training.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@OneToMany(targetEntity=Training.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
		@IndexColumn(name="list_index")
	@JoinColumn(name="Person_identifier")

	public List < Training > getTraining ( )
	{
		return this.get(IPerson.TRAINING) ;
	}
	
	public void setTraining (
								List < Training > training )
	{
		super.set(IPerson.TRAINING,training) ;
	}
	
//	@OneToMany(targetEntity=Working.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@OneToMany(targetEntity=Working.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@IndexColumn(name="list_index")
	@JoinColumn(name="Person_identifier")
	
	public List < IWorking > getWorking ( )
	{
		return this.get(IPerson.WORKING) ;
	}
	public void setWorking (
								List < IWorking > working )
	{
		super.set(IPerson.WORKING,working) ;
	}
//	@OneToMany(targetEntity=RewardsPunishment.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@OneToMany(targetEntity=RewardsPunishment.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@IndexColumn(name="list_index")
	@JoinColumn(name="Person_identifier")

	public List < IRewardsPunishment > getRewardsPunishment ( )
	{
		return this.get(IPerson.REWARDSPUNISHMENT) ;
	}
	public void setRewardsPunishment (
										List < IRewardsPunishment > rewardsPunishment )
	{
		super.set(IPerson.REWARDSPUNISHMENT,rewardsPunishment) ;
	}
//	@OneToMany(targetEntity=SkillLevel.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@OneToMany(targetEntity=SkillLevel.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@IndexColumn(name="list_index")
	@JoinColumn(name="Person_identifier")

	public List < ISkillLevel > getSkillLevel ( )
	{
		return this.get(IPerson.SKILLLEVEL) ;
	}
	public void setSkillLevel (
								List < ISkillLevel > skillLevel )
	{
		super.set(IPerson.SKILLLEVEL,skillLevel) ;
	}
	


	
		
		
//		@OneToMany(targetEntity=Contact.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
		@OneToMany(targetEntity=Contact.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
		@IndexColumn(name="list_index")
	@JoinColumn(name="Person_identifier")

		public List < Contact > getContact ( )
		{
		return this.get(IPerson.CONTACT) ;
		}




		public void setContact (
								List < Contact > contacts )
		{
			super.set(IPerson.CONTACT, contacts);
		}
		
		//现地址
		@OneToOne(targetEntity=Address.class,fetch=FetchType.LAZY)
		public String getNowAddress()
		{
			return this.get ( IPerson.NOWADDRESS );
		}
		public void setNowAddress(String nowaddress)
		{
			super.set ( IPerson.NOWADDRESS , nowaddress );
		}
		//身份证号码 
		@ Column ( name = "postalcodechar" , length = 50)
		@ Index ( name = "postalcodecharIndex" )
		public String getPostalCodeChar()
		{
			return this.get ( IPerson.POSTALCODECHAR );
		}
		public void setPostalCodeChar(String postalcodechar)
		{
			super.set ( IPerson.POSTALCODECHAR , postalcodechar );
		}
		//身份证扫描复印件正面
		@ Column ( name = "copyPostalCodeCharFace" , length = 50)
		@ Index ( name = "copyPostalCodeCharFaceIndex" )
		public String getCopyPostalCodeCharFace()
		{
			return this.get ( IPerson.COPYPOSTALCODECHARFACE );
		}
		public void setCopyPostalCodeCharFace(String copyPostalCodeCharFace)
		{
			super.set ( IPerson.COPYPOSTALCODECHARFACE , copyPostalCodeCharFace );
		}
		//身份证扫描复印件背面
		@ Column ( name = "copyPostalCodeCharBackFace" , length = 50)
		@ Index ( name = "copyPostalCodeCharBackFaceIndex" )
		public String getCopyPostalCodeCharBackFaces()
		{
			return this.get ( IPerson.COPYPOSTALCODECHARBACKFACES );
		}
		public void setCopyPostalCodeCharBackFaces(String copyPostalCodeCharBackFace)
		{
			super.set ( IPerson.COPYPOSTALCODECHARBACKFACES , copyPostalCodeCharBackFace );
		}
		//户口性质
		@ Column ( name = "category" , length = 50)
		@ Index ( name = "categoryIndex" )
		public String getCategory()
		{
			return this.get ( IPerson.CATEGORY );
		}
		public void setCategory(String category)
		{
			super.set ( IPerson.CATEGORY , category );
		}
		//所属部门
		@OneToOne(targetEntity=Organisation.class,fetch=FetchType.LAZY)
		public Organisation getOrganisation() {
			return this.get(IPerson.ORGANIZATION) ;
		}
		public void setOrganisation(Organisation organisation)
		{
			super.set ( IPerson.ORGANIZATION , organisation );
		}
		
		//职位
		@OneToOne(targetEntity=Position.class,fetch=FetchType.LAZY)
		public Position getPosition()
		{
			return this.get ( IPerson.POSITION );
		}
		public void setPosition(Position positon)
		{
			super.set ( IPerson.POSITION , positon );
		}
		//职务
		@ Column ( name = "office" , length = 50)
		@ Index ( name = "officeIndex" )
		public String getOffice()
		{
			return this.get ( IPerson.OFFICE );
		}
		public void setOffice(String office)
		{
			super.set ( IPerson.OFFICE , office );
		}
		//正式入职时间
		@Column(name="formalEntryTime",unique=false,nullable=true,insertable=true,updatable=true)
		@Temporal(TemporalType.DATE)
		public Date getFormalEntryTime ( )
		{
			return this.get(IPerson.FORMALENTRYTIME) ;
		}
		public void setFormalEntryTime(Date formalEntryTime)
		{
			super.set ( IPerson.FORMALENTRYTIME , formalEntryTime );
		}
		//工种
		@ Column ( name = "trades" , length = 50)
		@ Index ( name = "tradesIndex" )
		public String getTrades()
		{
			return this.get ( IPerson.TRADES );
		}
		public void setTrades(String trades)
		{
			super.set ( IPerson.TRADES , trades );
		}
		//职称
		@ Column ( name = "professionalTitle" , length = 50)
		@ Index ( name = "professionalTitleIndex" )
		public String getProfessionalTitle()
		{
			return this.get ( IPerson.PROFESSIONALTITLE );
		}
		public void setProfessionalTitle(String professionalTitle)
		{
			super.set ( IPerson.PROFESSIONALTITLE , professionalTitle );
		}
		//就业失业证号码
		@ Column ( name = "idCard" , length = 50)
		@ Index ( name = "idCardIndex" )
		public String getIdCard()
		{
			return this.get ( IPerson.IDCARD );
		}
		public void setIdCard(String idCard)
		{
			super.set ( IPerson.IDCARD , idCard );
		}
		
		//籍贯对应的省
		@OneToOne(targetEntity=Province.class,fetch=FetchType.LAZY)
		public Province getOrginProvince()
		{
			return this.get ( IPerson.ORGINPROVINCE );
		}
		public void setOrginProvince(Province province)
		{
			super.set ( IPerson.ORGINPROVINCE , province );
		}
		
		//籍贯对应的市
		@OneToOne(targetEntity=City.class,fetch=FetchType.LAZY)
		public City getOrginCity()
		{
			return this.get ( IPerson.ORGINCITY );
		}
		public void setOrginCity(City city)
		{
			super.set ( IPerson.ORGINCITY , city );
		}
		//现住址对应的省
		@OneToOne(targetEntity=Province.class,fetch=FetchType.LAZY)
		public Province getNowAddressProvince()
		{
			return this.get ( IPerson.ORGINPROVINCE );
		}
		public void setNowAddressProvince(Province province)
		{
			super.set ( IPerson.ORGINPROVINCE , province );
		}
		//现住址对应的市
		@OneToOne(targetEntity=City.class,fetch=FetchType.LAZY)
		public City getNowAddressCity()
		{
			return this.get ( IPerson.ORGINCITY );
		}
		public void setNowAddressCity(City city)
		{
			super.set ( IPerson.ORGINCITY , city );
		}

		/*@OneToMany(targetEntity=Supplier.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
		public List < Supplier > getSupplier ( )
		{
		return this.get(IPerson.SUPPLIER) ;
		}




		public void setSupplier (
								List < Supplier> supplier )
		{
			super.set(IPerson.SUPPLIER, supplier);
		}*/
		
		
		/*@OneToMany(targetEntity=Customer.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
		public List < Customer > getCustomer ( )
		{
		return this.get(IPerson.CUSTOMER) ;
		}




		public void setCustomer (
								List < Customer > customer )
		{
			super.set(IPerson.CUSTOMER, customer);
		}*/
		/*@OneToMany(targetEntity=Family.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
		public List < IFamily > getFamily ( )
		{
			return this.get(IPerson.FAMILY) ;
		}
		public void setFamily (
								List < IFamily > family )
		{
			super.set(IPerson.FAMILY,family) ;
		}*/

		/*@OneToMany(targetEntity=Health.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
		public List < IHealth > getHealth ( )
		{
			return this.get(IPerson.HEALTH) ;
		}
		public void setHealth (
								List < IHealth > health )
		{
			super.set(IPerson.HEALTH,health) ;
		}*/
		/*@OneToMany(targetEntity=PhysiqueCharacter.class,cascade=CascadeType.ALL,fetch=FetchType.LAZY)
		public List < IPhysiqueCharacter > getPhysiqueCharacter ( )
		{
			return this.get(IPerson.PHYSIQUECHARACTER) ;
		}
		public void setPhysiqueCharacter (
											List < IPhysiqueCharacter > physiqueCharacter )
		{
			super.set(IPerson.PHYSIQUECHARACTER,physiqueCharacter) ;
		}*/
}
